package com.citycloud.ccuap.tc.admin.repository;

import com.citycloud.ccuap.tc.admin.entity.SysProjectFunction;
import org.springframework.data.mybatis.repository.support.MybatisRepository;
import org.springframework.stereotype.Repository;

import java.util.List;

/**
 * 项目（站点）菜单数据库操作
 * @author sufeng
 *
 */

@Repository
public interface SysProjectFunctionRepository extends MybatisRepository<SysProjectFunction, String> {

	List<SysProjectFunction> findByProjectIdOrderByOrderNo(Long projectId);

	Long countByPidAndProjectId(String pid, Long projectId);

	SysProjectFunction findByFunId(String subfunid);

	List<SysProjectFunction> findByPidAndProjectIdOrderByOrderNo(String funId, Long projectId);

	List<SysProjectFunction> findByProjectIdAndFullPathContainingOrderByOrderNo(Long projectId, String funName);

	List<SysProjectFunction> findByProjectIdAndFunNameOrderByOrderNo(Long projectId, String name);

	List<SysProjectFunction> findByPidAndProjectId(String pid, Long projectId);

	List<SysProjectFunction> findByPidNullAndProjectIdOrderByOrderNo(Long projectId);

	SysProjectFunction findByFunIdAndProjectId(String funId, Long projectId);

	void deleteByProjectIdAndFunId(Long projectId, String funId);

	void deleteByProjectId(Long projectId);
}